package nl.rainbowsheep.reisorg.rest.service.repository;

import java.util.List;
import nl.rainbowsheep.reisorg.rest.service.model.Country;
import nl.rainbowsheep.reisorg.rest.service.model.Region;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;

/**
 * Repository for regions extends Jpa repo for crud operations
 */
public interface RegionRepository extends JpaRepository<Region, Long> {
    
    Region findByName(@Param("name") String name);

    Region findById(long id);

    List<Region> findByCountryId(long countryId); 
    
}
